package cn.hackcloud.demo.dubbo;

import cn.hackcloud.demo.dubbo.rpc.IUserService;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.hystrix.EnableHystrix;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ImportResource;

@ImportResource(locations = "classpath:dubbo.xml")
@SpringBootApplication
@EnableHystrix
public class ConsumerApplication {

    public static void main(String[] args) throws Exception {
        ConfigurableApplicationContext run = SpringApplication.run(ConsumerApplication.class, args);
        IUserService consumerService = run.getBean(IUserService.class);
        System.out.println(consumerService.sync(""));
//        ApiAsyncConsumer.mock();
        System.in.read();
    }

}
